<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="./js/axios.js"></script>
    <script>
        //axios 的通用写法  相当于 $.ajax()
        axios({
            method: "POST",  //请求方式 get  post  delete put
            url: "/product/product/getProductRecommendUser",//请求地址
            baseURL: "http://www.51houniao.com",//请求基础地址
            data: {//发送给后台的数据
                desc: false,
                orderBy: "top",
                pageNow: 1,
                pageSize: 20,
                seller_user_id: "4bc4027c645343f09a964b5c2e9f875b"
            },
            timeout: 1000,//请求的过期时间
            responseType: 'json',//请求的返回数据类型
            // proxy: {  //代理服务器 跨域
            //     host: '127.0.0.1',
            //     port: 9000,
            //     auth: {
            //         username: 'mikeymike',
            //         password: 'rapunz3l'
            //     }
            // },
            auth: {//设置发送到服务器的auth权限验证  token的数据
                username: 'janedoe',
                password: 's00pers3cret'
            },
            headers: { 'X-Requested-With': 'XMLHttpRequest' },//请求头设置

        }).then(res => {
            console.log(res);
        })


    </script>

</body>

</html>